$(function() {
	require(['inputdrop',
   'tree',
   'tab',
   'plot',
   'workorder',
   'event'] ,function (inputdrop ,tree ,tab ,plot ,workorder ,pevent){
   		var paramObj = {};
   		var key;
   		$("#searchIcon").click(function() {
        key = $("#searchKey").val();
        paramObj.keyWords = key;
        selected_asset_list_get({
          paramObj: paramObj,
          isLoad: true,
          maskObj: "body"
        });
      });

   		selected_asset_list_get({
        paramObj: paramObj,
        isLoad: true,
        maskObj: "body"
      });
	    
	    // 初始化表格数据内容
	    function selected_asset_list_get(opt) {
	      var list_url;
	      var header = [
	        { text: "姓名", name: "userName", width: 15, align: "center",tip:true},
	        { text: "警号", name: "policeId", width: 15, align: "center",tip:true},
	        { text: "警种", name: "classification", width: 15, align: "left" ,tip:true},
	        { text: "所属部门", name: "orgName", width: 15, align: "left",tip:true },
	        { text: "管控域名称", name: "systemName", width: 15, align: "left" ,tip:true},
	        { text: "部署网络", name: "networkName", width: 15, align: "left" ,tip:true},
	        {
	          text: "联系电话",
	          name: "mobile",
	          width: 15,
	          align: "left",tip:true
					},
					{ text: "uKey数量", name: "keyCount", width: 15, align: "left" },
	        { text: "TF卡数量", name: "tfCount", width: 15, align: "left" }
	      ];

	      list_url = "api/person/list";
				$("input[placeholder]").placeholder();
				
	      g_grid.render($("#table_div1"), {
	        header: header,
	        operWidth: "90px",
	        url: list_url,
	        type:'xd',
	        dataKey: 'list',
	        paramObj: opt.paramObj,
	        hasBorder : false,
	        hideSearch: true,
	        maskObj: opt.maskObj,
	        isLoad: opt.isLoad,
	        dbIndex: 1,
	        autoHeight: true,
	        showCount: true,
	        allowCheckBox: false
	      });
	    }

	    // 初始化筛选
	    xd_ajax_get({
				url: 'api/person/classificationList',
				isLoad: true,
				successCallBack: function(data) {
					var dataList = [];
					data ? (dataList = []) : (data = []);
					data.forEach(function(item) {
					dataList.push({ value: item, text: item });
					}, this);

					g_formel.list_filter_render($("um-filter") ,{
						condition : [
							{
								text : "警种" ,
								name : "classification" ,
								data : dataList
							}
						],
						click : function (paramObj){
							g_grid.refresh($("#table_div1") ,{
								paramObj : paramObj
							})
						}
					})
				}
			});
	  });
})